// 基础UI组件库导出
export { default as DeviceCard } from './DeviceCard/index.vue'
export { default as AccountCard } from './AccountCard/index.vue'
export { default as TaskItem } from './TaskItem/index.vue'
export { default as StatusCard } from './StatusCard/index.vue'
export { default as ContentPreview } from './ContentPreview/index.vue'
export { default as DataTable } from './DataTable/index.vue'

// 组件类型定义
export type { Device, SocialAccount, Task, ContentItem } from '@/types'

// 组件预设配置
export const componentPresets = {
  deviceCard: {
    defaultProps: {
      showActions: true,
      showStats: true
    }
  },
  accountCard: {
    defaultProps: {
      showStats: true,
      showLastLogin: true
    }
  },
  taskItem: {
    defaultProps: {
      showProgress: true,
      showActions: true
    }
  },
  statusCard: {
    defaultColors: {
      primary: '#409eff',
      success: '#67c23a',
      warning: '#e6a23c',
      danger: '#f56c6c',
      info: '#909399'
    }
  },
  dataTable: {
    defaultProps: {
      pageSize: 20,
      showPagination: true,
      showSearch: true
    }
  }
}

// 工具函数
export const componentUtils = {
  formatDate: (date: number | string | Date) => {
    return new Date(date).toLocaleString('zh-CN')
  },
  
  formatNumber: (num: number) => {
    return num.toLocaleString('zh-CN')
  },
  
  getStatusColor: (status: string) => {
    const statusColors = {
      online: '#67c23a',
      offline: '#f56c6c',
      busy: '#e6a23c',
      connecting: '#409eff',
      active: '#67c23a',
      inactive: '#909399',
      suspended: '#f56c6c',
      pending: '#e6a23c',
      running: '#409eff',
      completed: '#67c23a',
      failed: '#f56c6c',
      paused: '#e6a23c'
    }
    return statusColors[status as keyof typeof statusColors] || '#909399'
  },
  
  getPlatformIcon: (platform: string) => {
    const platformIcons = {
      tiktok: '🎵',
      facebook: '📘',
      instagram: '📷',
      twitter: '🐦',
      youtube: '📺',
      linkedin: '💼'
    }
    return platformIcons[platform as keyof typeof platformIcons] || '📱'
  }
}